import { Http } from "@/utils/request";
import { Toast } from "@/utils/toast";
import { delayTask } from "@/utils/timer";

const baseUrl = "/guider_home";

export const new_guide_index_api = (showError = true) => {
  return Http.get<{
    banner: any[];
    now_live: any[];
    menu_title: any[];
    new_guide_sachet: any[];
    live: any[];
    select_course: any[];
    offline_course: any[];
    guide_vip_ad_pic: string;
    follow_study: any[];
  }>(`${baseUrl}/new_guide/index`).catch((error: Error) => {
    showError && delayTask(60, () => Toast.show(error.message));
    return Promise.reject(error);
  });
};
